import Toast from '../../miniprogram_npm/tdesign-miniprogram/toast/index';

interface Example {
  title: string;
  desc: string;
  path: string;
}

interface IPageData {
  examples: Example[];
}

Page<IPageData>({
  data: {
    examples: [
      {
        title: '基础组件',
        desc: 'Button、Input、Cell 等基础组件示例',
        path: '/pages/examples/basic/index'
      },
      {
        title: '表单组件',
        desc: 'Form、Checkbox、Radio 等表单组件示例',
        path: '/pages/examples/form/index'
      },
      {
        title: '反馈组件',
        desc: 'Toast、Dialog、Loading 等反馈组件示例',
        path: '/pages/examples/feedback/index'
      }
    ]
  },

  onTapExample(e: any) {
    const { path } = e.currentTarget.dataset;
    wx.navigateTo({ url: path });
  }
}); 